﻿<%@ Page Title="Update Status" Theme="POSSystem" Language="C#" MasterPageFile="~/EditPages/Popup.Master"
    AutoEventWireup="true" CodeBehind="UpdateStatus.aspx.cs" Inherits="WebUI.EditPages.UpdateStatus" %>

<asp:Content ID="Content1" ContentPlaceHolderID="PopupHeadHolder" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="PopupToolbarHolder" runat="server">
    <table class="popuptoolbar" width="100%">
        <tr>
            <td style="vertical-align: middle; text-align: left">
                <asp:LinkButton class="tbbutton" ValidationGroup="Save" ID="btnSaveClose" runat="server"
                    OnClick="btnSaveAndClose_OnClick">
                    <img src="../Images/tb_SaveAndClose.gif" /><asp:Label ID="label2" runat="server"
                        Text=" Save and Close"></asp:Label>
                </asp:LinkButton>
            </td>
        </tr>
    </table>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="PopupContentHolder" runat="server">
    <script type="text/javascript">
        function rb_onclick(rb) {
            deselectChk();
            document.getElementById("<%=txtNote.ClientID %>").value = rb.parentNode.getAttribute('Desc') + " ";
            document.getElementById("<%=hidStatusID.ClientID %>").value = rb.parentNode.getAttribute('StatusID');
        }

        function deselectRb() {
            var input = document.getElementsByTagName("input");
  
            for (var i = 0; i < input.length; i++) {
                if (input[i].type == "radio") {
                    document.getElementById("<%=txtNote.ClientID %>").value = document.getElementById("<%=txtNote.ClientID %>").value.replace(input[i].parentNode.getAttribute('Desc'), '');
                    input[i].checked = false;
                }

            }
        }

        function deselectChk() {
            var input = document.getElementsByTagName("input");
        
            for (var i = 0; i < input.length; i++) {
                if (input[i].type == "checkbox") {
                    input[i].checked = false;
                    document.getElementById("<%=txtNote.ClientID %>").value = document.getElementById("<%=txtNote.ClientID %>").value.replace(input[i].parentNode.getAttribute('Desc'), '');
                }
            }
        }

        function chk_onclick(chk) {
            deselectRb();
            var testOnly = false;
            if (chk.parentNode.getAttribute('StatusID') != '0')
                document.getElementById("<%=hidStatusID.ClientID %>").value = chk.parentNode.getAttribute('StatusID');
            else
                testOnly = true;

            if (chk.checked) {
                document.getElementById("<%=txtNote.ClientID %>").value += chk.parentNode.getAttribute('Desc') + " ";
                if (testOnly) {
                    var hid = document.getElementById("<%=hidTestOnly.ClientID %>");
                    hid.value = parseInt(hid.value) + 1;
                }
            }
            else {
                if (testOnly) {
                    var hid = document.getElementById("<%=hidTestOnly.ClientID %>");
                    hid.value = parseInt(hid.value) - 1;
                }
                document.getElementById("<%=txtNote.ClientID %>").value = document.getElementById("<%=txtNote.ClientID %>").value.replace(chk.parentNode.getAttribute('Desc'), '');
            }
        }
    </script>
    <table>
        <tr>
            <td align="left" valign="top">
                <table>
                    <tr>
                        <td align="left" valign="top">
                            <table width="100%">
                                <tr>
                                    <td align="left" valign="top" class="CustomGridHeader" style='width:300px'>
                                        Technician Repair Note
                                    </td>
                                    <td align="left" valign="top" class="CustomGridHeader" style='width:200px'>
                                        Other
                                    </td>
                                </tr>
                                <tr>
                                    <td align="left" valign="top">
                                        <asp:Button ID="Button1" runat="server" Text="OK G/A" OnClick="btnOKGA_OnClick" /> <br />
                                        <asp:RadioButton onclick='rb_onclick(this);' GroupName="RepairNote" ID="rbUrgent"
                                            runat="server" Text="Void - No Sealt (or Broken )" Desc="Void - No Sealt (or Broken )" class="labelMessage" StatusID="0" /><br />
                                        <asp:RadioButton onclick='rb_onclick(this);' GroupName="RepairNote" ID="rbVoidNoSealt"
                                            runat="server" Text="Urgent Please !!!" Desc="Urgent Please !!!" class="labelMessage" StatusID="0" /><br />
                                        <asp:RadioButton onclick='rb_onclick(this);' GroupName="RepairNote" ID="rbDefected"
                                            runat="server" Text="Defected by thirth party technician" Desc="Defected by thirth party technician" class="labelMessage"
                                            StatusID="0" /><br />
                                    </td>
                                    <td align="left" valign="top">
                                        <asp:RadioButton onclick='rb_onclick(this);' GroupName="RepairNote" ID="rbNewProblemFound"
                                            runat="server" Text="New problem found:" Desc="New problem found:" class="labelMessage" StatusID="0" /><br />
                                        <asp:RadioButton onclick='rb_onclick(this);' GroupName="RepairNote" ID="RadioButton9"
                                            runat="server" Text="Under Warranty" Desc="Under Warranty" class="labelMessage" StatusID="0" />
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td align="left" valign="top">
                            <table  width="100%">
                                <tr>
                                    <td align="left" valign="top" class="CustomGridHeader" style='width:300px'>
                                        Waiting
                                    </td>
                                    <td align="left" valign="top" class="CustomGridHeader" style='width:200px'>
                                        Rejected
                                    </td>
                                </tr>
                                <tr>
                                    <td align="left" valign="top">
                                        <asp:RadioButton onclick='rb_onclick(this);' GroupName="RepairNote" ID="RadioButton1"
                                            runat="server" Text="Waiting For Parts" Desc="Waiting For Parts" class="labelMessage" StatusID="2" /><br />
                                        <asp:RadioButton onclick='rb_onclick(this);' GroupName="RepairNote" ID="RadioButton2"
                                            runat="server" Text="Away - Service Center" Desc="Away - Service Center" class="labelMessage" StatusID="2" /><br />
                                        <asp:RadioButton onclick='rb_onclick(this);' GroupName="RepairNote" ID="RadioButton3"
                                            runat="server" Text="Do It Later" Desc="Do It Later" class="labelMessage" StatusID="2" /><br />
                                        <asp:RadioButton onclick='rb_onclick(this);' GroupName="RepairNote" ID="RadioButton5"
                                            runat="server" Text="Waiting for Software" Desc="Waiting for Software" class="labelMessage" StatusID="2" />
                                    </td>
                                    <td align="left" valign="top">
                                        <asp:RadioButton onclick='rb_onclick(this);' GroupName="RepairNote" ID="RadioButton4"
                                            runat="server" Text="Customer Rejected" Desc="Customer Rejected" class="labelMessage" StatusID="5" /><br />
                                        <asp:RadioButton onclick='rb_onclick(this);' GroupName="RepairNote" ID="RadioButton6"
                                            runat="server" Text="BER" Desc="BER" class="labelMessage" StatusID="5" /><br />
                                        <asp:RadioButton onclick='rb_onclick(this);' GroupName="RepairNote" ID="RadioButton7"
                                            runat="server" Text="No Part" Desc="No Part" class="labelMessage" StatusID="5" /><br />
                                        <asp:RadioButton onclick='rb_onclick(this);' GroupName="RepairNote" ID="RadioButton8"
                                            runat="server" Text="No Software" Desc="No Software" class="labelMessage" StatusID="5" /><br />
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td align="left" valign="top">
                            <table  width="100%">
                                <tr>
                                    <td align="left" valign="top" class="CustomGridHeader" style='width:300px'>
                                        Job Done
                                    </td>
                                    <td align="left" valign="top" class="CustomGridHeader" style='width:200px' >
                                        Testing
                                    </td>
                                </tr>
                                <tr>
                                    <td align="left" valign="top">
                                        <asp:CheckBox onclick='chk_onclick(this);' GroupName="RepairNote" ID="CheckBox9"
                                            runat="server" Text="Unlocked" Desc="Unlocked" class="labelMessage" StatusID="4" /><br />
                                        <asp:CheckBox onclick='chk_onclick(this);' GroupName="RepairNote" ID="CheckBox10"
                                            runat="server" Text="Software Upgraded" Desc="Software Upgraded" class="labelMessage" StatusID="4" /><br />
                                        <asp:CheckBox onclick='chk_onclick(this);' GroupName="RepairNote" ID="CheckBox11"
                                            runat="server" Text="Parts Replaced" Desc="Parts Replaced" class="labelMessage" StatusID="4" /><br />
                                        <asp:CheckBox onclick='chk_onclick(this);' GroupName="RepairNote" ID="CheckBox12"
                                            runat="server" Text="IC Component Replaced" Desc="IC Component Replaced" class="labelMessage" StatusID="4" /><br />
                                        <asp:CheckBox onclick='chk_onclick(this);' GroupName="RepairNote" ID="CheckBox1"
                                            runat="server" Text="Board Replacement" Desc="Board Replacement" class="labelMessage" StatusID="4" /><br />
                                        <asp:CheckBox onclick='chk_onclick(this);' GroupName="RepairNote" ID="CheckBox2"
                                            runat="server" Text="No Problem Found" Desc="No Problem Found" class="labelMessage" StatusID="4" />
                                    </td>
                                    <td align="left" valign="top">
                                        <asp:CheckBox onclick='chk_onclick(this);' GroupName="RepairNote" ID="CheckBox13"
                                            runat="server" Text="Tested to specification" Desc="Tested to specification" class="labelMessage" StatusID="0" /><br />
                                        <asp:CheckBox onclick='chk_onclick(this);' GroupName="RepairNote" ID="CheckBox14"
                                            runat="server" Text="Tested on air" Desc="Tested on air" class="labelMessage" StatusID="0" />
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td align="center" valign="top">
                <asp:TextBox ID="txtNote" runat="server" TextMode="MultiLine" Rows="6" Width="500px"></asp:TextBox>
                <asp:HiddenField ID="hidStatusID" runat="server" />
                <asp:HiddenField ID="hidTestOnly" runat="server" Value="0" />
            </td>
        </tr>
    </table>
</asp:Content>
